﻿using System;
using System.Collections.Generic;
using System.Collections;

namespace CSharp.Libs.Koc.ItemClasses
{
    /// <summary>CityItem</summary>
    /// <history>created  14.02.2012</history>
    public class CityItem
    {
        #region declarations
        private Int64 _intCityID = 0;
        private String _strCityName = "";
        private Int64 _intXCoord = 0;
        private Int64 _intYCoord = 0;
        private Int64 _intProvinceID = 0;
        private Int64 _intMapTileID = 0;
        #endregion



        #region constructor / terminator
        public CityItem()
        {
        }

        public CityItem(
            Kernel KRNL,
            ArrayList aryCityItem)
        {
            _readCityItem(KRNL, aryCityItem);
        }
        #endregion



        #region event handling
        #endregion



        #region private functions
        private void _readCityItem(
            Kernel KRNL,
            ArrayList aryCityItem)
        {
            _intCityID = KRNL.GetObjectValue(aryCityItem[0], KernelTools.VariableTypes.Int64);
            _strCityName = KRNL.GetObjectValue(aryCityItem[1], KernelTools.VariableTypes.String);
            _intXCoord = KRNL.GetObjectValue(aryCityItem[2], KernelTools.VariableTypes.Int64);
            _intYCoord = KRNL.GetObjectValue(aryCityItem[3], KernelTools.VariableTypes.Int64);
            _intProvinceID = KRNL.GetObjectValue(aryCityItem[4], KernelTools.VariableTypes.Int64);
            _intMapTileID = KRNL.GetObjectValue(aryCityItem[5], KernelTools.VariableTypes.Int64);
        }
        #endregion



        #region interface
        #region properties
        public Int64 MapTileID
        {
            get
            {
                return _intMapTileID;
            }
            set
            {
                _intMapTileID = value;
            }
        }

        public Int64 ProvinceID
        {
            get
            {
                return _intProvinceID;
            }
            set
            {
                _intProvinceID = value;
            }
        }

        public Int64 yCoord
        {
            get
            {
                return _intYCoord;
            }
            set
            {
                _intYCoord = value;
            }
        }

        public Int64 xCoord
        {
            get
            {
                return _intXCoord;
            }
            set
            {
                _intXCoord = value;
            }
        }

        public String CityName
        {
            get
            {
                return _strCityName;
            }
            set
            {
                _strCityName = value;
            }
        }

        public Int64 CityID
        {
            get
            {
                return _intCityID;
            }
            set
            {
                _intCityID = value;
            }
        }
        #endregion

        #region methods
        /// <summary>ReadCityItem</summary>
        /// <param name="KRNL"></param>
        /// <param name="aryCityItem"></param>
        /// <history>created  14.02.2012</history>
        public void ReadCityItem(
            Kernel KRNL,
            ArrayList aryCityItem)
        {
            _readCityItem(KRNL, aryCityItem);
        }
        #endregion
        #endregion
    }
}
